package tool.file.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;

public class ReadConfig {

    private static Logger log = Logger.getLogger(ReadFileUtil.class);

    private static Properties p = new Properties();

    static {
        InputStream is = null;
        try {
            is = ReadConfig.class.getClassLoader().getResourceAsStream(
                    "config.properties");
            p.load(is);
            log.info("Read proerties successfully!");
        } catch (IOException e) {
            log.info("Error occur when read properties!");
            e.printStackTrace();
        }
    }

    public static String getValue(String key) {

        return p.getProperty(key);
    }
}
